<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Insert title here</title>
<script type="text/javascript" language="javascript">
	var i=4;
	function addVoteOption(){
		var voteP= document.getElementById("voteOptionList");
		var inputText = document.createTextNode("Option "+(i++)+":");
		voteP.appendChild(inputText);
		var inputP=document.createElement("input");
		inputP.type="text";
		inputP.name="voteOption";
		voteP.appendChild(inputP);
		var brP = document.createElement("br");
		voteP.appendChild(brP);
	}
</script>
</head>
<body>
	<s:form action="voteAction-add.do" method="post">
		选择频道：<select name="channelName">
			<option value="1">财经</option>
			<option value="2">体育</option>
			<option value="3">新闻</option>
			<option value="4">时尚</option>
			<option value="5">科技</option>
		</select>
		<br/>
		投票名称：<input type="text" name="voteName">
		<br/>
		<div id="voteOptionList">
			Option 1:<input type="text" name="voteOption"/><br/>
			Option 2:<input type="text" name="voteOption"/><br/>
			Option 3:<input type="text" name="voteOption"/><br/>
		</div>
		<input type="button" value="新增投票选项" onclick="addVoteOption()"/>
		<input type="submit" value="提交"/>
		<input type="reset" value="重置"/>
	</s:form>

</body>
</html>